// Copyright (C) 2010 David Sugar, Tycho Softworks.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _APENNINE_SERVICE_H_
#define _APENNINE_SERVICE_H_

#ifndef _UCOMMON_LINKED_H_
#include <ucommon/linked.h>
#endif

namespace apennine {

class __SHARED Service : public LinkedObject
{
private:
    __DELETE_DEFAULTS(Service);

protected:
    virtual void Start(void);
    virtual void Reload(void);
    virtual void Stop(void);
    virtual unsigned Prep(sstream *client);
    virtual unsigned Reply(sstream *client);

public:
    typedef enum {HIGH = 0, LOW = 1, NODE = 2} level_t;

    static LinkedObject *runlist[3];
    static keyfile config;

    Service(level_t runlevel = LOW);
};

} // end namespace

#endif
